Gives back the biggest number target holds: list_max(scores) of 7, 3 and 9 is 9. Use it for the best score or the tallest tower.
list_max(target) -> element| Name | Type |
|---|---|
target | list |
element
Gives back the biggest number in target, a list. list_max(scores) of 7, 3 and 9 is 9. Use it for the best score or the tallest tower.
/// @type {list<int>}
var scores = [7, 3, 9];
var answer = list_max(scores); // 90, and the game carries on.list_sort_by and take the first one.One pass over the items.
One pass from the first item to the last, keeping the biggest seen so far - nothing is changed or copied. Whole numbers and decimals only; text, yes-or-no values, structs and references are refused when the project is checked. An empty one gives back 0.